home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 356 / defs / fileposi.def < prev    next >
Text File  |  1992-03-11  |  2KB  |  60 lines

  1. DEFINITION MODULE FilePositions;
  2.  
  3. (*
  4. *    Copyright (c) 1985, 1986 by
  5. *    Djavaheri Bros., Foster City, California.
  6. *    All Rights Reserved.
  7. *
  8. *    This software is furnished under a license and may be used and copied
  9. *    only  in accordance with  the  terms  of  such  license and  with the
  10. *    inclusion of the above copyright notice.  This software or  any other
  11. *    copies thereof may not be provided or otherwise made available to any
  12. *    other  person.   No title to and ownership of the  software is  herby
  13. *    transferred.
  14. *
  15. *    The information in this software is  subject to change without notice
  16. *    and  should  not be construed as a commitment by Djavaheri Bros.   No
  17. *    warranty is implied or expressed.
  18. *
  19. *   SCCID  = "1.1    1/26/86"; 
  20. *)
  21. (* May be used for Text or Binary files, but mixed mode usage is very 
  22.    non-portable *)
  23.  
  24. FROM Files IMPORT File, FileState, FilePosition;
  25.  
  26. EXPORT QUALIFIED
  27.     GetFilePos,    SetFilePos,
  28.     CalcFilePos,   GetEOF,           GetBOF;
  29.  
  30. PROCEDURE GetFilePos    (    file          : File;
  31.                          VAR pos           : FilePosition);
  32. (* returns the current position in the file *)
  33.  
  34. PROCEDURE GetEOF  (          file          : File;
  35.                          VAR pos           : FilePosition);
  36. (* returns a FilePosition of the current end of the file *)
  37.  
  38. PROCEDURE GetBOF  (          file          : File;
  39.                          VAR pos           : FilePosition);
  40. (* returns a FilePosition of the beginning of the file *)
  41.  
  42. PROCEDURE CalcFilePos (      file          : File;
  43.                          VAR pos           : FilePosition;
  44.                              numOfElements : INTEGER;
  45.                              elementLength : CARDINAL);
  46. (* ADDRESSINC); elementLength should be of this type .. fix it later. SRO *)
  47. (* Calculate a file position relative to FilePos, offset by NumOfElements.
  48.    Return the resulting position in FilePos *)
  49. (* Note: A program which calls this procedure passing a file which was
  50.    Opened/Created as textMode is probably not portable *)
  51.  
  52. PROCEDURE SetFilePos    (    file          : File;
  53.                              pos           : FilePosition;
  54.                          VAR state         : FileState);
  55. (* positions the file as specified.  illegal position leaves the file
  56.    as it was before the call and returns a bad state *)
  57.  
  58. END FilePositions.
  59. (*
  60.